import React, { Component } from 'react'
import Item from '../Item'
import './index.css'

export default class List extends Component {
  render() {
    const {todoArr, doneTodo} = this.props
    return (
      <div>
        <ul className='todo-list common-border'>
            {
                todoArr.map((item, index) => {
                    return (
                        // 每一项
                        <Item 
                          key={item.id} 
                          {...item} 
                          doneTodo={doneTodo}
                          deleteTodo={this.props.deleteTodo}
                        />
                    )
                })
            }
        </ul>
      </div>
    )
  }
}
